Skip to content

fix(security): support directory paths with path separators in secret keys#24824

Merged
pront merged 5 commits intovectordotdev:masterfrom
vparfonov:pront-secrets-dir-fix
Mar 2, 2026
Merged

fix(security): support directory paths with path separators in secret keys#24824
pront merged 5 commits intovectordotdev:masterfrom
vparfonov:pront-secrets-dir-fix

Conversation

@vparfonov
Copy link
Contributor

@vparfonov vparfonov commented Mar 2, 2026

Summary

This fixes an issue where directory secret backends failed to resolve secrets organized in subdirectories (e.g., Kubernetes mounted secrets at paths like: /secrets/my-secrets/username).

Vector configuration

[secret.kubernetes_secret]
type = "directory"
path = "/var/run/ocp-collector/secrets"

[sinks.output_http]
type = "http"
uri = "http://localhost:8090"
method = "post"

[sinks.output_http.auth]
strategy = "basic"
user = "SECRET[kubernetes_secret.mysecrets/username]"
password = "SECRET[kubernetes_secret.mysecrets/password]"

How did you test this PR?

  • Add unit tests
  • Add integration test with nested directory structure

Change Type

  • Bug fix
  • New feature
  • Dependencies
  • Non-functional (chore, refactoring, docs)
  • Performance

Is this a breaking change?

  • Yes
  • No

Does this PR include user facing changes?

  • Yes. Please add a changelog fragment based on our guidelines.
  • No. A maintainer will apply the no-changelog label to this PR.

References

Notes

  • Please read our Vector contributor resources.
  • Do not hesitate to use @vectordotdev/vector to reach out to us regarding this PR.
  • Some CI checks run only after we manually approve them.
    • We recommend adding a pre-push hook, please see this template.
    • Alternatively, we recommend running the following locally before pushing to the remote branch:
      • make fmt
      • make check-clippy (if there are failures it's possible some of them can be fixed with make clippy-fix)
      • make test
  • After a review is requested, please avoid force pushes to help us review incrementally.
    • Feel free to push as many commits as you want. They will be squashed into one before merging.
    • For example, you can run git merge origin master and git push.
  • If this PR introduces changes Vector dependencies (modifies Cargo.lock), please
    run make build-licenses to regenerate the license inventory and commit the changes (if any). More details here.

@vparfonov vparfonov requested a review from a team as a code owner March 2, 2026 17:33
@vparfonov vparfonov changed the title fix(secrets): support directory paths with with path separators in secret keys fix(security): support directory paths with with path separators in secret keys Mar 2, 2026
Copy link
Member

@pront pront left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @vparfonov. This makes sense to me.

Copy link
Member

@pront pront left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a changelog to explain the bug this PR fixes. I believe the community will find it useful.

@vparfonov vparfonov changed the title fix(security): support directory paths with with path separators in secret keys fix(security): support directory paths with path separators in secret keys Mar 2, 2026
@pront pront enabled auto-merge March 2, 2026 18:25
auto-merge was automatically disabled March 2, 2026 18:47

Head branch was pushed to by a user without write access

@pront pront enabled auto-merge March 2, 2026 19:59
@pront pront added this pull request to the merge queue Mar 2, 2026
Merged via the queue into vectordotdev:master with commit 8b603dd Mar 2, 2026
51 checks passed
@pront pront deleted the pront-secrets-dir-fix branch March 2, 2026 20:54
@github-actions github-actions bot locked and limited conversation to collaborators Mar 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Secret resolution fails for directory backend with path separators with: "No secret placeholder found"

2 participants